package com.hdu.hdu.invoker;

import com.hdu.hdu.context.StudentInfoCheckContext;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

@Slf4j
public class StudentSaveInvoker implements Invoker<StudentInfoCheckContext> {
    @Override
    public void finalProcess(StudentInfoCheckContext context) {
        Map<String, String> errorMsg = context.getErrorMsg();
        if (!errorMsg.isEmpty()) {
            log.error("学生信息校验失败 : {}", errorMsg);
        } else {
            log.info("插入学生信息 : {}", context.getStudent());
        }
    }
}
